package com.poetize.plus.entity.dto;

import com.poetize.plus.entity.po.Barrage;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

/**
 * @author zuosy
 * @created 2024/5/14 14:16
 */
public record BarrageDTO(

        @Schema(description = "弹幕内容")
        @NotNull(message = "弹幕不能为空")
        String content
) {

    /**
     * DTO赚实体类
     *
     * @param barrageDTO
     * @return
     */
    public static Barrage convertDTO(BarrageDTO barrageDTO) {
        return new Barrage(null, barrageDTO.content);
    }
}
